package www.wen.com.common.lib.data.network

import okhttp3.MultipartBody
import retrofit2.Call
import www.wen.com.common.lib.data.entities.*


/**
 * @author WEN
 * @Description:
 * @date 2020/11/25 11:11
 */
interface ApiHelper {

    suspend fun requestVerifyCode(
            requestVerifyBody: RequestVerifyBody,
    ): Result<VerifyCodeEntity>

    suspend fun requestChannelId(
            channelId: Long,
    ): Result<ChannelInfo>

    suspend fun patchChannel(
            channelId: Long,
            requestBodyParameter: RequestBodyParameter
    ): Result<ChannelInfo>

    suspend fun deleteChannel(
        channelId: Long
    ): Result<String>

    suspend fun deleteGroup(
            groupId: String,
    ): Result<String>

    suspend fun requestInviteList(
           serverId: String,
           page: Int,
           size: Int,
    ): Result<InvitationEntity>

    suspend fun requestRegister(
            type: String,
            requestRegisterBody: RequestRegisterBody,
    ): Result<LoginInfo>

    suspend fun requestSmsLogin(requestRegisterBody: RequestRegisterBody): Result<LoginInfo>

    suspend fun requestAccessToken(code: String): Result<WxEntity>

    suspend fun requestResetPassword(body: RequestBodyParameter): Result<UseInfoEntity>

    suspend fun requestUploadOssFile(
            partMap: Map<String, okhttp3.RequestBody>,
            vararg file: MultipartBody.Part,
    ): Result<UpOssFileEntity>

    suspend fun searchUserByNickName(nickName: String): Result<UseInfoEntity>

    suspend fun requestUserInfoById(id: String): Result<UseInfoEntity>

    suspend fun requestLoginOrRegisterByToken(
            type: String,
            body: RequestLoginOrRegisterByToken,
    ): Result<EmptyEntity>

    suspend fun requestRegisterByToken(
            body: RequestLoginOrRegisterByToken,
    ): Result<LoginInfo>

    suspend fun requestCreateServer(
            body: RequestBodyParameter,
    ): Result<ServerEntity>

    suspend fun requestServerSelfList(
            page: Int,
            size: Int,
    ): Result<ServerSelfListEntity>

    suspend fun requestServersMemberList(
            serverId: String,
            nickName: String?,
            page: Int,
            size: Int,
    ): Result<ServiceMemberListEntity>

    suspend fun requestUsersOnlineStatus(
            accids: Array<String>,
    ): Result<List<UseInfoEntity>>

    suspend fun requestServerGroupList(
            serverId: String,
    ): Result<ServerGroupEntity>


    suspend fun requestServerList(
            serverIdOrName: String?,
            recommendFlag: String?,
            page: Int?,
            size: Int?,
    ): Result<ServerListEntity>

    suspend fun requestInviteOrAdd(
            type: String,
            body: RequestBodyParameter,
    ): Result<String>

    suspend fun requestVerifyMobile(
            body: RequestBodyParameter,
    ): Result<String>

    suspend fun requestServerDetails(
            serverId:String,
    ): Result<ServerInfo>

    fun addServerChannelTopMsg(
        body: RequestServerChannelTopMsgBodyParameter
    ): Call<String>

    suspend fun getServerChannelTopMsgList(
        teamId: String,
    ): Result<TopMsgEntity>

    fun deleteServerChannelTopMsg(
        uuid: String,
    ): Call<String>

    suspend fun requestServerPreview(
            serverId: String,
    ): Result<ServerSelfListEntity.Content>

    suspend fun requestUpdateServerInfo(
            serverId: String,
            body: RequestBodyParameter,
    ): Result<ServerUpdateInfoEntity>

    suspend fun requestCreateChannel(
            body: RequestBodyParameter,
    ): Result<ChannelEntity>

    suspend fun requestServerGroup(
            serverId: String,
    ): Result<List<GroupingEntity>>

    suspend fun requestServerShareUrl(
        body: RequestBodyParameter,
    ): Result<ShareUrlEntity>

    suspend fun requestMemberSetting(
            id: String,
            body: RequestBodyParameter,
    ): Result<String>

    suspend fun requestCreateNewGroup(
            body: RequestBodyParameter,
    ): Result<GroupingEntity>

    suspend fun requestDeleteServer(
            serverId: String
    ): Result<String>

    suspend fun requestChangeOwnerOrKick(
            type: String,
            body: RequestBodyParameter,
    ): Result<String>

    suspend fun requestChangeMobile(
        body: RequestBodyParameter,
    ): Result<String>

    suspend fun requestUserInfo(body: RequestBodyParameter): Result<UseInfoEntity>

    suspend fun requestShareFind(body: RequestBodyParameter): Result<JoinServerEntity>

    suspend fun requestMemberInvite(body: RequestBodyParameter): Result<String>

    suspend fun requestExitServers(serverId: String): Result<String>

    suspend fun requestBatch(body: List<RequestBodyParameter>): Result<List<ChannelBatchEntity>>

    suspend fun requestGroupSort(body: List<RequestBodyParameter>): Result<List<ChannelBatchEntity>>

    suspend fun requestStartPage(size:Int,page:Int): Result<StartPageEntity>

    suspend fun requestUserInfo(): Result<UseInfoEntity>

    suspend fun requestProtocol(map:Map<String,String>): Result<ProtocolEntity>

    suspend fun requestServerOfficial(): Result<ServerSelfListEntity.Content>

    suspend fun requestUpdateGroup(groupId: String, body: RequestBodyParameter): Result<ServerGroupEntity.Content>

    suspend fun requestRemove(): Result<String>

    suspend fun requestTokenRevoke(): Result<String>

}